import LLMApp from "./LLMApp.vue";
import { createApp } from "vue";
import { setupStore } from "@/store";

// 引入重置样式
import "@/style/reset.scss";
// 导入公共样式
import "@/style/index.scss";
// 一定要在main.ts中导入tailwind.css，防止vite每次hmr都会请求src/style/index.scss整体css文件导致热更新慢的问题
import "@/style/tailwind.css";
import "element-plus/dist/index.css";
// 导入字体图标
import "@/assets/iconfont/iconfont.js";
import "@/assets/iconfont/iconfont.css";

const app = createApp(LLMApp);

// 全局注册@iconify/vue图标库
import {
  IconifyIconOffline,
  IconifyIconOnline,
  FontIcon
} from "@/components/ReIcon";
app.component("IconifyIconOffline", IconifyIconOffline);
app.component("IconifyIconOnline", IconifyIconOnline);
app.component("FontIcon", FontIcon);

import * as ElementPlusIconsVue from "@element-plus/icons-vue";

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}

// 全局注册vue-tippy
import "tippy.js/dist/tippy.css";
import "tippy.js/themes/light.css";
import VueTippy from "vue-tippy";

import { useElementPlus } from "@/plugins/elementPlus";
app.use(VueTippy).use(useElementPlus);

import router from "./router";
app.use(router);

import elTableInfiniteScroll from "el-table-infinite-scroll";
app.use(elTableInfiniteScroll);
setupStore(app);
app.mount("#app");
